{# A deploy job (overseer_deploy_actions.job_context), streamed while the page is open. Whole (Jobs, New server): where its steps stand (its step bar), what it is doing, how it ended, and its output's tail, folded. On a card: only that one runs, with a link to it (the card's controls hide meanwhile, input.css). A provision that stopped part way offers, on both, to resume it or destroy what it made. #} {% from "components/macros/layout.html" import copy_button, progress %} {% from "pages/overseer/deployments/_macros.html" import fold, goto, stopped %} {% if job %} {% set whole = job.whole %}
{% if whole and job.steps %}
    {% for s in job.steps %} {% set at = s.status in ("current", "failed") %}
  1. {# Done full, under way sweeping, failed full and red, to come empty. #} {{ progress({"current": none, "todo": 0}.get(s.status, 1), {"failed": "error", "todo": "muted"}.get(s.status, "ok"), s.title, "h-1.5") }} {{ s.title }}
  2. {% endfor %}
{% endif %} {% if whole or job.status == "running" or job.stopped %}

{% if job.status == "running" and not whole %}{% endif %} {{ job.title }} {% if job.status == "running" %}{{ job.label if whole else "running" }} {% elif job.status == "failed" %}{{ job.error }} {% else %}Done{% endif %} {% if job.url and not whole %}{{ goto(job.url, "Open", "data-job-link") }}{% endif %}

{% endif %} {% if job.stopped %}{{ stopped(job.partials, job.stopped) }}{% endif %} {# Folded; open stays open across the stream's swaps (job_panel's ``output``), and each swap shows its newest line (reversed, the box starts at its bottom). Its scrollbar always shows (daisyUI's ``scrollbar-color`` on every element would hide a styled one), and its scrolling stays in it. #} {% if whole and job.lines %} {% set attrs %}data-output x-bind:open="output" x-on:toggle="output = $el.open"{% endset %} {% call fold("Show output", attrs) %}
{{ copy_button(job.lines|join("\n")) }}
{{ job.lines|join("\n") }}
{% endcall %} {% endif %}
{% endif %}